Skip to content

feat(examples): migrate tap_battle session lifecycle to SessionManager#235

Merged
salazarsebas merged 6 commits into
salazarsebas:mainfrom
madisonsc52-del:feat/session-manager-fresh
Jul 3, 2026
Merged

feat(examples): migrate tap_battle session lifecycle to SessionManager#235
salazarsebas merged 6 commits into
salazarsebas:mainfrom
madisonsc52-del:feat/session-manager-fresh

Conversation

@madisonsc52-del

@madisonsc52-del madisonsc52-del commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

🚀 Summary
This PR refactors the tap_battle example contract to migrate its local session lifecycle management over to the centralized SessionManager. This cleans up redundant code, establishes a standard implementation pattern for session limits, and ensures the example aligns with upstream architectural patterns.

🛠️ Changes
src/auth.rs & src/lib.rs: Replaced standalone session validation handlers with native SessionManager hooks.

src/test.rs: Implemented an robust suite of 17 passing unit tests verifying player registration, combo streak logic, multiplier caps, and session expiration panics.

Toolchain Optimization: Verified clean WebAssembly target builds (wasm32v1-none) without altering or corrupting the project's root Cargo.toml.

🧪 Testing Checklist
All 17 local unit tests passing cleanly (cargo test)

Contract compiles to target natively (stellar contract build)

CLOSE #224

@madisonsc52-del

Copy link
Copy Markdown
Contributor Author

@salazarsebas
Please Review and Ping Back

@madisonsc52-del

Copy link
Copy Markdown
Contributor Author

@salazarsebas
PLEASE REVIEW AND PING BACK 🙏🏽🙏🏽🙏🏽🙏🏽

madisonsc52-del and others added 2 commits July 1, 2026 01:06
- Run cargo fmt to fix CI formatting failures
- Bump cougr-core to 1.1.0
- Remove unused SessionState and DataKey::Session types
- Fix renew test to compare absolute expires_at before renew
- Document SessionManager lifecycle and timestamp-based duration
- Add session_arena README with cross-reference to tap_battle

@salazarsebas salazarsebas left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@madisonsc52-del

Copy link
Copy Markdown
Contributor Author

@salazarsebas
Please Review and merge

@madisonsc52-del

Copy link
Copy Markdown
Contributor Author

@salazarsebas
Issue Resolved Review and Ping Back

@salazarsebas salazarsebas merged commit 9e4088e into salazarsebas:main Jul 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(examples): migrate tap_battle session lifecycle to SessionManager

2 participants